shared_examples_for "calc" do
  it "works as expected" do
    expect(calc(0, 0, 15)).to eq(15)
    expect(calc(0, 0, 27)).to eq(27)
    expect(calc(0, 2, 0)).to eq(nil)
    expect(calc(0, 2, 16)).to eq(18)
    expect(calc(0, 3, 9)).to eq(12)
    expect(calc(0, 3, 12)).to eq(15)
    expect(calc(0, 3, 15)).to eq(18)
    expect(calc(0, 3, 16)).to eq(19)
    expect(calc(0, 3, 20)).to eq(23)
    expect(calc(0, 4, 12)).to eq(16)
    expect(calc(0, 5, 16)).to eq(21)
    expect(calc(0, 5, 18)).to eq(23)
    expect(calc(0, 7, 6)).to eq(13)
    expect(calc(0, 8, 15)).to eq(23)
    expect(calc(0, 8, 25)).to eq(33)
    expect(calc(0, 9, 2)).to eq(11)
    expect(calc(0, 9, 3)).to eq(12)
    expect(calc(0, 9, 28)).to eq(37)
    expect(calc(0, 10, 7)).to eq(17)
    expect(calc(0, 10, 11)).to eq(21)
    expect(calc(0, 10, 17)).to eq(27)
    expect(calc(0, 11, 2)).to eq(13)
    expect(calc(0, 11, 26)).to eq(37)
    expect(calc(0, 12, 8)).to eq(20)
    expect(calc(0, 12, 11)).to eq(23)
    expect(calc(0, 12, 24)).to eq(36)
    expect(calc(0, 13, 15)).to eq(28)
    expect(calc(0, 14, 26)).to eq(40)
    expect(calc(0, 14, 27)).to eq(41)
    expect(calc(0, 15, 26)).to eq(41)
    expect(calc(0, 15, 27)).to eq(42)
    expect(calc(0, 16, 14)).to eq(30)
    expect(calc(0, 17, 17)).to eq(34)
    expect(calc(0, 20, 21)).to eq(41)
    expect(calc(0, 21, 20)).to eq(41)
    expect(calc(0, 21, 28)).to eq(49)
    expect(calc(0, 22, 15)).to eq(37)
    expect(calc(0, 23, 11)).to eq(34)
    expect(calc(0, 24, 0)).to eq(24)
    expect(calc(0, 24, 8)).to eq(32)
    expect(calc(0, 24, 16)).to eq(40)
    expect(calc(0, 25, 4)).to eq(29)
    expect(calc(0, 25, 6)).to eq(31)
    expect(calc(0, 25, 12)).to eq(37)
    expect(calc(0, 27, 7)).to eq(34)
    expect(calc(0, 27, 16)).to eq(43)
    expect(calc(0, 28, 27)).to eq(55)
    expect(calc(0, 29, 1)).to eq(30)
    expect(calc(1, 0, 3)).to eq(nil)
    expect(calc(1, 1, 5)).to eq(nil)
    expect(calc(1, 1, 29)).to eq(29)
    expect(calc(1, 2, 16)).to eq(17)
    expect(calc(1, 2, 17)).to eq(18)
    expect(calc(1, 2, 22)).to eq(23)
    expect(calc(1, 4, 13)).to eq(16)
    expect(calc(1, 4, 15)).to eq(18)
    expect(calc(1, 4, 16)).to eq(19)
    expect(calc(1, 5, 2)).to eq(nil)
    expect(calc(1, 5, 13)).to eq(17)
    expect(calc(1, 5, 16)).to eq(20)
    expect(calc(1, 6, 4)).to eq(nil)
    expect(calc(1, 6, 23)).to eq(28)
    expect(calc(1, 8, 19)).to eq(26)
    expect(calc(1, 10, 5)).to eq(14)
    expect(calc(1, 10, 10)).to eq(19)
    expect(calc(1, 11, 12)).to eq(22)
    expect(calc(1, 12, 0)).to eq(11)
    expect(calc(1, 12, 18)).to eq(29)
    expect(calc(1, 12, 27)).to eq(38)
    expect(calc(1, 13, 8)).to eq(20)
    expect(calc(1, 15, 6)).to eq(20)
    expect(calc(1, 15, 9)).to eq(23)
    expect(calc(1, 15, 14)).to eq(28)
    expect(calc(1, 16, 19)).to eq(34)
    expect(calc(1, 17, 13)).to eq(29)
    expect(calc(1, 17, 19)).to eq(35)
    expect(calc(1, 19, 1)).to eq(19)
    expect(calc(1, 19, 21)).to eq(39)
    expect(calc(1, 20, 6)).to eq(25)
    expect(calc(1, 20, 12)).to eq(31)
    expect(calc(1, 20, 15)).to eq(34)
    expect(calc(1, 20, 25)).to eq(44)
    expect(calc(1, 24, 12)).to eq(35)
    expect(calc(1, 25, 12)).to eq(36)
    expect(calc(1, 25, 24)).to eq(48)
    expect(calc(1, 26, 12)).to eq(37)
    expect(calc(1, 26, 17)).to eq(42)
    expect(calc(1, 26, 19)).to eq(44)
    expect(calc(1, 27, 5)).to eq(31)
    expect(calc(1, 27, 9)).to eq(35)
    expect(calc(1, 27, 16)).to eq(42)
    expect(calc(1, 28, 17)).to eq(44)
    expect(calc(1, 29, 17)).to eq(45)
    expect(calc(1, 29, 19)).to eq(47)
    expect(calc(1, 29, 24)).to eq(52)
    expect(calc(2, 0, 9)).to eq(nil)
    expect(calc(2, 0, 21)).to eq(19)
    expect(calc(2, 0, 22)).to eq(20)
    expect(calc(2, 1, 28)).to eq(27)
    expect(calc(2, 2, 8)).to eq(nil)
    expect(calc(2, 2, 27)).to eq(27)
    expect(calc(2, 3, 16)).to eq(17)
    expect(calc(2, 4, 25)).to eq(27)
    expect(calc(2, 5, 2)).to eq(nil)
    expect(calc(2, 6, 21)).to eq(25)
    expect(calc(2, 6, 25)).to eq(29)
    expect(calc(2, 6, 29)).to eq(33)
    expect(calc(2, 7, 2)).to eq(nil)
    expect(calc(2, 7, 21)).to eq(26)
    expect(calc(2, 7, 25)).to eq(30)
    expect(calc(2, 8, 24)).to eq(30)
    expect(calc(2, 8, 26)).to eq(32)
    expect(calc(2, 9, 10)).to eq(17)
    expect(calc(2, 11, 9)).to eq(18)
    expect(calc(2, 11, 10)).to eq(19)
    expect(calc(2, 11, 25)).to eq(34)
    expect(calc(2, 12, 6)).to eq(16)
    expect(calc(2, 12, 9)).to eq(19)
    expect(calc(2, 12, 11)).to eq(21)
    expect(calc(2, 12, 29)).to eq(39)
    expect(calc(2, 13, 28)).to eq(39)
    expect(calc(2, 13, 29)).to eq(40)
    expect(calc(2, 14, 11)).to eq(23)
    expect(calc(2, 14, 14)).to eq(26)
    expect(calc(2, 14, 25)).to eq(37)
    expect(calc(2, 15, 1)).to eq(14)
    expect(calc(2, 15, 23)).to eq(36)
    expect(calc(2, 16, 2)).to eq(16)
    expect(calc(2, 16, 8)).to eq(22)
    expect(calc(2, 16, 15)).to eq(29)
    expect(calc(2, 16, 28)).to eq(42)
    expect(calc(2, 17, 11)).to eq(26)
    expect(calc(2, 18, 19)).to eq(35)
    expect(calc(2, 18, 25)).to eq(41)
    expect(calc(2, 19, 28)).to eq(45)
    expect(calc(2, 20, 3)).to eq(21)
    expect(calc(2, 20, 12)).to eq(30)
    expect(calc(2, 21, 9)).to eq(28)
    expect(calc(2, 21, 26)).to eq(45)
    expect(calc(2, 22, 6)).to eq(26)
    expect(calc(2, 22, 11)).to eq(31)
    expect(calc(2, 22, 22)).to eq(42)
    expect(calc(2, 24, 15)).to eq(37)
    expect(calc(2, 27, 10)).to eq(35)
    expect(calc(2, 27, 12)).to eq(37)
    expect(calc(3, 0, 3)).to eq(nil)
    expect(calc(3, 0, 23)).to eq(20)
    expect(calc(3, 0, 26)).to eq(23)
    expect(calc(3, 0, 29)).to eq(26)
    expect(calc(3, 1, 25)).to eq(23)
    expect(calc(3, 2, 7)).to eq(nil)
    expect(calc(3, 2, 13)).to eq(12)
    expect(calc(3, 3, 5)).to eq(nil)
    expect(calc(3, 3, 29)).to eq(29)
    expect(calc(3, 4, 17)).to eq(18)
    expect(calc(3, 4, 29)).to eq(30)
    expect(calc(3, 5, 19)).to eq(21)
    expect(calc(3, 6, 0)).to eq(nil)
    expect(calc(3, 6, 19)).to eq(22)
    expect(calc(3, 7, 1)).to eq(nil)
    expect(calc(3, 8, 1)).to eq(nil)
    expect(calc(3, 8, 19)).to eq(24)
    expect(calc(3, 8, 21)).to eq(26)
    expect(calc(3, 8, 25)).to eq(30)
    expect(calc(3, 9, 4)).to eq(10)
    expect(calc(3, 9, 11)).to eq(17)
    expect(calc(3, 10, 3)).to eq(10)
    expect(calc(3, 10, 9)).to eq(16)
    expect(calc(3, 13, 29)).to eq(39)
    expect(calc(3, 14, 15)).to eq(26)
    expect(calc(3, 15, 19)).to eq(31)
    expect(calc(3, 15, 27)).to eq(39)
    expect(calc(3, 16, 7)).to eq(20)
    expect(calc(3, 16, 8)).to eq(21)
    expect(calc(3, 17, 9)).to eq(23)
    expect(calc(3, 17, 15)).to eq(29)
    expect(calc(3, 18, 22)).to eq(37)
    expect(calc(3, 18, 24)).to eq(39)
    expect(calc(3, 18, 27)).to eq(42)
    expect(calc(3, 18, 29)).to eq(44)
    expect(calc(3, 20, 6)).to eq(23)
    expect(calc(3, 20, 8)).to eq(25)
    expect(calc(3, 20, 11)).to eq(28)
    expect(calc(3, 20, 13)).to eq(30)
    expect(calc(3, 21, 6)).to eq(24)
    expect(calc(3, 21, 18)).to eq(36)
    expect(calc(3, 22, 1)).to eq(20)
    expect(calc(3, 22, 27)).to eq(46)
    expect(calc(3, 23, 13)).to eq(33)
    expect(calc(3, 23, 22)).to eq(42)
    expect(calc(3, 23, 25)).to eq(45)
    expect(calc(3, 24, 2)).to eq(23)
    expect(calc(3, 24, 8)).to eq(29)
    expect(calc(3, 24, 23)).to eq(44)
    expect(calc(3, 25, 3)).to eq(25)
    expect(calc(3, 25, 16)).to eq(38)
    expect(calc(3, 26, 9)).to eq(32)
    expect(calc(3, 26, 26)).to eq(49)
    expect(calc(3, 28, 26)).to eq(51)
    expect(calc(3, 29, 7)).to eq(33)
    expect(calc(3, 29, 8)).to eq(34)
    expect(calc(3, 29, 13)).to eq(39)
    expect(calc(3, 29, 17)).to eq(43)
    expect(calc(4, 0, 1)).to eq(nil)
    expect(calc(4, 0, 6)).to eq(nil)
    expect(calc(4, 0, 15)).to eq(11)
    expect(calc(4, 1, 12)).to eq(9)
    expect(calc(4, 1, 13)).to eq(10)
    expect(calc(4, 2, 2)).to eq(nil)
    expect(calc(4, 3, 0)).to eq(nil)
    expect(calc(4, 3, 26)).to eq(25)
    expect(calc(4, 4, 4)).to eq(nil)
    expect(calc(4, 5, 6)).to eq(7)
    expect(calc(4, 5, 19)).to eq(20)
    expect(calc(4, 7, 15)).to eq(18)
    expect(calc(4, 7, 26)).to eq(29)
    expect(calc(4, 8, 14)).to eq(18)
    expect(calc(4, 9, 13)).to eq(18)
    expect(calc(4, 11, 14)).to eq(21)
    expect(calc(4, 11, 23)).to eq(30)
    expect(calc(4, 12, 4)).to eq(12)
    expect(calc(4, 12, 10)).to eq(18)
    expect(calc(4, 14, 16)).to eq(26)
    expect(calc(4, 14, 19)).to eq(29)
    expect(calc(4, 14, 22)).to eq(32)
    expect(calc(4, 15, 8)).to eq(19)
    expect(calc(4, 15, 28)).to eq(39)
    expect(calc(4, 16, 10)).to eq(22)
    expect(calc(4, 16, 24)).to eq(36)
    expect(calc(4, 18, 15)).to eq(29)
    expect(calc(4, 18, 27)).to eq(41)
    expect(calc(4, 20, 26)).to eq(42)
    expect(calc(4, 21, 14)).to eq(31)
    expect(calc(4, 22, 4)).to eq(22)
    expect(calc(4, 23, 13)).to eq(32)
    expect(calc(4, 27, 9)).to eq(32)
    expect(calc(4, 28, 22)).to eq(46)
    expect(calc(4, 29, 1)).to eq(26)
    expect(calc(4, 29, 8)).to eq(33)
    expect(calc(5, 0, 9)).to eq(nil)
    expect(calc(5, 0, 12)).to eq(7)
    expect(calc(5, 1, 15)).to eq(11)
    expect(calc(5, 2, 14)).to eq(11)
    expect(calc(5, 2, 22)).to eq(19)
    expect(calc(5, 3, 20)).to eq(18)
    expect(calc(5, 4, 8)).to eq(7)
    expect(calc(5, 4, 15)).to eq(14)
    expect(calc(5, 4, 16)).to eq(15)
    expect(calc(5, 4, 17)).to eq(16)
    expect(calc(5, 5, 18)).to eq(18)
    expect(calc(5, 5, 23)).to eq(23)
    expect(calc(5, 5, 26)).to eq(26)
    expect(calc(5, 7, 14)).to eq(16)
    expect(calc(5, 9, 25)).to eq(29)
    expect(calc(5, 10, 3)).to eq(8)
    expect(calc(5, 10, 27)).to eq(32)
    expect(calc(5, 10, 28)).to eq(33)
    expect(calc(5, 11, 5)).to eq(11)
    expect(calc(5, 12, 3)).to eq(10)
    expect(calc(5, 13, 15)).to eq(23)
    expect(calc(5, 13, 25)).to eq(33)
    expect(calc(5, 14, 10)).to eq(19)
    expect(calc(5, 14, 17)).to eq(26)
    expect(calc(5, 14, 18)).to eq(27)
    expect(calc(5, 14, 24)).to eq(33)
    expect(calc(5, 15, 22)).to eq(32)
    expect(calc(5, 15, 29)).to eq(39)
    expect(calc(5, 16, 4)).to eq(15)
    expect(calc(5, 16, 8)).to eq(19)
    expect(calc(5, 16, 25)).to eq(36)
    expect(calc(5, 17, 1)).to eq(13)
    expect(calc(5, 17, 8)).to eq(20)
    expect(calc(5, 18, 4)).to eq(17)
    expect(calc(5, 18, 27)).to eq(40)
    expect(calc(5, 18, 28)).to eq(41)
    expect(calc(5, 26, 28)).to eq(49)
    expect(calc(5, 28, 0)).to eq(23)
    expect(calc(5, 28, 7)).to eq(30)
    expect(calc(5, 29, 18)).to eq(42)
    expect(calc(6, 0, 10)).to eq(nil)
    expect(calc(6, 1, 12)).to eq(7)
    expect(calc(6, 1, 21)).to eq(16)
    expect(calc(6, 2, 17)).to eq(13)
    expect(calc(6, 2, 21)).to eq(17)
    expect(calc(6, 3, 15)).to eq(12)
    expect(calc(6, 4, 8)).to eq(6)
    expect(calc(6, 4, 28)).to eq(26)
    expect(calc(6, 6, 3)).to eq(nil)
    expect(calc(6, 6, 4)).to eq(nil)
    expect(calc(6, 6, 14)).to eq(14)
    expect(calc(6, 6, 15)).to eq(15)
    expect(calc(6, 6, 20)).to eq(20)
    expect(calc(6, 7, 10)).to eq(11)
    expect(calc(6, 8, 10)).to eq(12)
    expect(calc(6, 9, 1)).to eq(nil)
    expect(calc(6, 9, 16)).to eq(19)
    expect(calc(6, 10, 7)).to eq(11)
    expect(calc(6, 11, 23)).to eq(28)
    expect(calc(6, 12, 11)).to eq(17)
    expect(calc(6, 13, 3)).to eq(10)
    expect(calc(6, 14, 1)).to eq(9)
    expect(calc(6, 14, 13)).to eq(21)
    expect(calc(6, 14, 17)).to eq(25)
    expect(calc(6, 15, 20)).to eq(29)
    expect(calc(6, 16, 0)).to eq(10)
    expect(calc(6, 16, 22)).to eq(32)
    expect(calc(6, 17, 3)).to eq(14)
    expect(calc(6, 18, 6)).to eq(18)
    expect(calc(6, 20, 26)).to eq(40)
    expect(calc(6, 21, 29)).to eq(44)
    expect(calc(6, 22, 20)).to eq(36)
    expect(calc(6, 23, 23)).to eq(40)
    expect(calc(6, 25, 26)).to eq(45)
    expect(calc(6, 26, 3)).to eq(23)
    expect(calc(6, 26, 13)).to eq(33)
    expect(calc(6, 27, 6)).to eq(27)
    expect(calc(6, 27, 7)).to eq(28)
    expect(calc(6, 28, 28)).to eq(50)
    expect(calc(6, 29, 10)).to eq(33)
    expect(calc(6, 29, 23)).to eq(46)
    expect(calc(7, 1, 11)).to eq(5)
    expect(calc(7, 2, 20)).to eq(15)
    expect(calc(7, 3, 16)).to eq(12)
    expect(calc(7, 3, 25)).to eq(21)
    expect(calc(7, 3, 28)).to eq(24)
    expect(calc(7, 6, 8)).to eq(7)
    expect(calc(7, 6, 14)).to eq(13)
    expect(calc(7, 6, 16)).to eq(15)
    expect(calc(7, 8, 10)).to eq(11)
    expect(calc(7, 8, 29)).to eq(30)
    expect(calc(7, 9, 22)).to eq(24)
    expect(calc(7, 9, 24)).to eq(26)
    expect(calc(7, 10, 2)).to eq(5)
    expect(calc(7, 10, 28)).to eq(31)
    expect(calc(7, 11, 14)).to eq(18)
    expect(calc(7, 12, 9)).to eq(14)
    expect(calc(7, 12, 19)).to eq(24)
    expect(calc(7, 12, 28)).to eq(33)
    expect(calc(7, 13, 4)).to eq(10)
    expect(calc(7, 13, 18)).to eq(24)
    expect(calc(7, 14, 4)).to eq(11)
    expect(calc(7, 14, 7)).to eq(14)
    expect(calc(7, 14, 14)).to eq(21)
    expect(calc(7, 15, 27)).to eq(35)
    expect(calc(7, 16, 7)).to eq(16)
    expect(calc(7, 16, 9)).to eq(18)
    expect(calc(7, 16, 10)).to eq(19)
    expect(calc(7, 17, 29)).to eq(39)
    expect(calc(7, 18, 1)).to eq(12)
    expect(calc(7, 18, 29)).to eq(40)
    expect(calc(7, 19, 3)).to eq(15)
    expect(calc(7, 19, 7)).to eq(19)
    expect(calc(7, 19, 18)).to eq(30)
    expect(calc(7, 19, 19)).to eq(31)
    expect(calc(7, 20, 0)).to eq(13)
    expect(calc(7, 20, 22)).to eq(35)
    expect(calc(7, 22, 25)).to eq(40)
    expect(calc(7, 23, 4)).to eq(20)
    expect(calc(7, 23, 8)).to eq(24)
    expect(calc(7, 23, 11)).to eq(27)
    expect(calc(7, 23, 16)).to eq(32)
    expect(calc(7, 24, 12)).to eq(29)
    expect(calc(7, 24, 24)).to eq(41)
    expect(calc(7, 24, 27)).to eq(44)
    expect(calc(7, 25, 2)).to eq(20)
    expect(calc(7, 25, 13)).to eq(31)
    expect(calc(7, 26, 23)).to eq(42)
    expect(calc(7, 27, 3)).to eq(23)
    expect(calc(7, 27, 5)).to eq(25)
    expect(calc(7, 28, 2)).to eq(23)
    expect(calc(7, 28, 20)).to eq(41)
    expect(calc(8, 0, 24)).to eq(16)
    expect(calc(8, 0, 26)).to eq(18)
    expect(calc(8, 1, 13)).to eq(6)
    expect(calc(8, 2, 4)).to eq(nil)
    expect(calc(8, 2, 10)).to eq(4)
    expect(calc(8, 2, 19)).to eq(13)
    expect(calc(8, 3, 1)).to eq(nil)
    expect(calc(8, 3, 3)).to eq(nil)
    expect(calc(8, 3, 15)).to eq(10)
    expect(calc(8, 3, 18)).to eq(13)
    expect(calc(8, 3, 25)).to eq(20)
    expect(calc(8, 4, 12)).to eq(8)
    expect(calc(8, 4, 16)).to eq(12)
    expect(calc(8, 5, 3)).to eq(nil)
    expect(calc(8, 5, 9)).to eq(6)
    expect(calc(8, 5, 10)).to eq(7)
    expect(calc(8, 6, 2)).to eq(nil)
    expect(calc(8, 6, 3)).to eq(nil)
    expect(calc(8, 6, 10)).to eq(8)
    expect(calc(8, 7, 5)).to eq(4)
    expect(calc(8, 8, 5)).to eq(5)
    expect(calc(8, 9, 17)).to eq(18)
    expect(calc(8, 9, 23)).to eq(24)
    expect(calc(8, 10, 1)).to eq(3)
    expect(calc(8, 10, 3)).to eq(5)
    expect(calc(8, 10, 22)).to eq(24)
    expect(calc(8, 11, 7)).to eq(10)
    expect(calc(8, 11, 28)).to eq(31)
    expect(calc(8, 13, 6)).to eq(11)
    expect(calc(8, 13, 17)).to eq(22)
    expect(calc(8, 13, 26)).to eq(31)
    expect(calc(8, 14, 19)).to eq(25)
    expect(calc(8, 15, 2)).to eq(9)
    expect(calc(8, 15, 12)).to eq(19)
    expect(calc(8, 15, 18)).to eq(25)
    expect(calc(8, 15, 24)).to eq(31)
    expect(calc(8, 16, 4)).to eq(12)
    expect(calc(8, 16, 10)).to eq(18)
    expect(calc(8, 17, 10)).to eq(19)
    expect(calc(8, 17, 27)).to eq(36)
    expect(calc(8, 18, 17)).to eq(27)
    expect(calc(8, 19, 28)).to eq(39)
    expect(calc(8, 20, 7)).to eq(19)
    expect(calc(8, 20, 24)).to eq(36)
    expect(calc(8, 20, 29)).to eq(41)
    expect(calc(8, 21, 14)).to eq(27)
    expect(calc(8, 21, 16)).to eq(29)
    expect(calc(8, 21, 23)).to eq(36)
    expect(calc(8, 21, 25)).to eq(38)
    expect(calc(8, 22, 19)).to eq(33)
    expect(calc(8, 23, 1)).to eq(16)
    expect(calc(8, 24, 12)).to eq(28)
    expect(calc(8, 24, 22)).to eq(38)
    expect(calc(8, 24, 24)).to eq(40)
    expect(calc(8, 25, 8)).to eq(25)
    expect(calc(8, 25, 16)).to eq(33)
    expect(calc(8, 25, 20)).to eq(37)
    expect(calc(8, 27, 1)).to eq(20)
    expect(calc(8, 27, 4)).to eq(23)
    expect(calc(8, 27, 21)).to eq(40)
    expect(calc(8, 28, 16)).to eq(36)
    expect(calc(8, 28, 18)).to eq(38)
    expect(calc(8, 29, 8)).to eq(29)
    expect(calc(8, 29, 9)).to eq(30)
    expect(calc(9, 0, 12)).to eq(3)
    expect(calc(9, 4, 3)).to eq(nil)
    expect(calc(9, 5, 29)).to eq(25)
    expect(calc(9, 6, 16)).to eq(13)
    expect(calc(9, 6, 24)).to eq(21)
    expect(calc(9, 7, 11)).to eq(9)
    expect(calc(9, 7, 22)).to eq(20)
    expect(calc(9, 7, 24)).to eq(22)
    expect(calc(9, 7, 25)).to eq(23)
    expect(calc(9, 8, 2)).to eq(nil)
    expect(calc(9, 8, 3)).to eq(2)
    expect(calc(9, 8, 8)).to eq(7)
    expect(calc(9, 8, 14)).to eq(13)
    expect(calc(9, 8, 15)).to eq(14)
    expect(calc(9, 9, 1)).to eq(nil)
    expect(calc(9, 9, 28)).to eq(28)
    expect(calc(9, 10, 19)).to eq(20)
    expect(calc(9, 10, 21)).to eq(22)
    expect(calc(9, 12, 25)).to eq(28)
    expect(calc(9, 13, 17)).to eq(21)
    expect(calc(9, 13, 18)).to eq(22)
    expect(calc(9, 14, 11)).to eq(16)
    expect(calc(9, 14, 22)).to eq(27)
    expect(calc(9, 15, 19)).to eq(25)
    expect(calc(9, 16, 11)).to eq(18)
    expect(calc(9, 16, 19)).to eq(26)
    expect(calc(9, 16, 23)).to eq(30)
    expect(calc(9, 17, 4)).to eq(12)
    expect(calc(9, 17, 26)).to eq(34)
    expect(calc(9, 18, 3)).to eq(12)
    expect(calc(9, 18, 10)).to eq(19)
    expect(calc(9, 18, 19)).to eq(28)
    expect(calc(9, 18, 29)).to eq(38)
    expect(calc(9, 19, 21)).to eq(31)
    expect(calc(9, 19, 24)).to eq(34)
    expect(calc(9, 20, 9)).to eq(20)
    expect(calc(9, 20, 19)).to eq(30)
    expect(calc(9, 20, 28)).to eq(39)
    expect(calc(9, 21, 29)).to eq(41)
    expect(calc(9, 22, 5)).to eq(18)
    expect(calc(9, 23, 5)).to eq(19)
    expect(calc(9, 23, 26)).to eq(40)
    expect(calc(9, 23, 27)).to eq(41)
    expect(calc(9, 24, 12)).to eq(27)
    expect(calc(9, 24, 17)).to eq(32)
    expect(calc(9, 25, 27)).to eq(43)
    expect(calc(9, 27, 0)).to eq(18)
    expect(calc(9, 27, 3)).to eq(21)
    expect(calc(9, 27, 5)).to eq(23)
    expect(calc(9, 27, 11)).to eq(29)
    expect(calc(9, 27, 15)).to eq(33)
    expect(calc(9, 27, 24)).to eq(42)
    expect(calc(9, 28, 10)).to eq(29)
    expect(calc(9, 28, 23)).to eq(42)
    expect(calc(9, 29, 7)).to eq(27)
    expect(calc(10, 0, 29)).to eq(19)
    expect(calc(10, 1, 23)).to eq(14)
    expect(calc(10, 2, 28)).to eq(20)
    expect(calc(10, 3, 8)).to eq(1)
    expect(calc(10, 3, 23)).to eq(16)
    expect(calc(10, 6, 0)).to eq(nil)
    expect(calc(10, 6, 14)).to eq(10)
    expect(calc(10, 6, 19)).to eq(15)
    expect(calc(10, 6, 25)).to eq(21)
    expect(calc(10, 6, 29)).to eq(25)
    expect(calc(10, 7, 1)).to eq(nil)
    expect(calc(10, 8, 20)).to eq(18)
    expect(calc(10, 9, 14)).to eq(13)
    expect(calc(10, 9, 28)).to eq(27)
    expect(calc(10, 10, 3)).to eq(3)
    expect(calc(10, 10, 27)).to eq(27)
    expect(calc(10, 11, 20)).to eq(21)
    expect(calc(10, 11, 21)).to eq(22)
    expect(calc(10, 11, 22)).to eq(23)
    expect(calc(10, 12, 24)).to eq(26)
    expect(calc(10, 17, 29)).to eq(36)
    expect(calc(10, 18, 14)).to eq(22)
    expect(calc(10, 18, 23)).to eq(31)
    expect(calc(10, 18, 25)).to eq(33)
    expect(calc(10, 20, 0)).to eq(10)
    expect(calc(10, 21, 27)).to eq(38)
    expect(calc(10, 23, 13)).to eq(26)
    expect(calc(10, 23, 25)).to eq(38)
    expect(calc(10, 24, 4)).to eq(18)
    expect(calc(10, 24, 15)).to eq(29)
    expect(calc(10, 24, 23)).to eq(37)
    expect(calc(10, 25, 1)).to eq(16)
    expect(calc(10, 25, 17)).to eq(32)
    expect(calc(10, 25, 26)).to eq(41)
    expect(calc(10, 27, 12)).to eq(29)
    expect(calc(10, 27, 17)).to eq(34)
    expect(calc(10, 27, 26)).to eq(43)
    expect(calc(10, 28, 2)).to eq(20)
    expect(calc(10, 29, 3)).to eq(22)
    expect(calc(10, 29, 7)).to eq(26)
    expect(calc(10, 29, 8)).to eq(27)
    expect(calc(10, 29, 14)).to eq(33)
    expect(calc(10, 29, 27)).to eq(46)
    expect(calc(11, 0, 19)).to eq(30)
    expect(calc(11, 0, 22)).to eq(-11)
    expect(calc(11, 1, 1)).to eq(13)
    expect(calc(11, 1, 20)).to eq(32)
    expect(calc(11, 2, 11)).to eq(24)
    expect(calc(11, 2, 27)).to eq(-14)
    expect(calc(11, 3, 18)).to eq(32)
    expect(calc(11, 3, 19)).to eq(33)
    expect(calc(11, 3, 27)).to eq(-13)
    expect(calc(11, 4, 11)).to eq(26)
    expect(calc(11, 4, 19)).to eq(34)
    expect(calc(11, 4, 22)).to eq(-7)
    expect(calc(11, 5, 0)).to eq(16)
    expect(calc(11, 6, 0)).to eq(17)
    expect(calc(11, 7, 6)).to eq(24)
    expect(calc(11, 7, 9)).to eq(27)
    expect(calc(11, 7, 21)).to eq(-3)
    expect(calc(11, 7, 25)).to eq(-7)
    expect(calc(11, 8, 25)).to eq(-6)
    expect(calc(11, 9, 10)).to eq(30)
    expect(calc(11, 9, 25)).to eq(-5)
    expect(calc(11, 10, 5)).to eq(26)
    expect(calc(11, 11, 0)).to eq(22)
    expect(calc(11, 11, 8)).to eq(30)
    expect(calc(11, 11, 9)).to eq(31)
    expect(calc(11, 11, 15)).to eq(-8)
    expect(calc(11, 11, 24)).to eq(-26)
    expect(calc(11, 11, 27)).to eq(-32)
    expect(calc(11, 12, 18)).to eq(-13)
    expect(calc(11, 13, 6)).to eq(30)
    expect(calc(11, 13, 9)).to eq(33)
    expect(calc(11, 13, 26)).to eq(-28)
    expect(calc(11, 14, 11)).to eq(3)
    expect(calc(11, 15, 0)).to eq(26)
    expect(calc(11, 15, 17)).to eq(-8)
    expect(calc(11, 15, 20)).to eq(-14)
    expect(calc(11, 15, 27)).to eq(-28)
    expect(calc(11, 15, 29)).to eq(-32)
    expect(calc(11, 16, 1)).to eq(28)
    expect(calc(11, 17, 15)).to eq(-2)
    expect(calc(11, 17, 22)).to eq(-16)
    expect(calc(11, 18, 3)).to eq(32)
    expect(calc(11, 18, 15)).to eq(-1)
    expect(calc(11, 19, 3)).to eq(33)
    expect(calc(11, 21, 12)).to eq(8)
    expect(calc(11, 21, 17)).to eq(-2)
    expect(calc(11, 21, 19)).to eq(-6)
    expect(calc(11, 23, 15)).to eq(4)
    expect(calc(11, 23, 22)).to eq(-10)
    expect(calc(11, 23, 27)).to eq(-20)
    expect(calc(11, 24, 7)).to eq(42)
    expect(calc(11, 25, 5)).to eq(41)
    expect(calc(11, 25, 9)).to eq(45)
    expect(calc(11, 25, 13)).to eq(10)
    expect(calc(11, 26, 1)).to eq(38)
    expect(calc(11, 29, 20)).to eq(0)
    expect(calc(12, 0, 5)).to eq(17)
    expect(calc(12, 0, 18)).to eq(30)
    expect(calc(12, 1, 8)).to eq(21)
    expect(calc(12, 1, 24)).to eq(-11)
    expect(calc(12, 2, 2)).to eq(16)
    expect(calc(12, 3, 4)).to eq(19)
    expect(calc(12, 3, 5)).to eq(20)
    expect(calc(12, 5, 1)).to eq(18)
    expect(calc(12, 6, 0)).to eq(18)
    expect(calc(12, 6, 3)).to eq(21)
    expect(calc(12, 7, 6)).to eq(25)
    expect(calc(12, 7, 27)).to eq(-8)
    expect(calc(12, 8, 3)).to eq(23)
    expect(calc(12, 8, 5)).to eq(25)
    expect(calc(12, 8, 27)).to eq(-7)
    expect(calc(12, 9, 9)).to eq(30)
    expect(calc(12, 10, 21)).to eq(1)
    expect(calc(12, 11, 5)).to eq(28)
    expect(calc(12, 12, 18)).to eq(-12)
    expect(calc(12, 12, 19)).to eq(-14)
    expect(calc(12, 12, 28)).to eq(-32)
    expect(calc(12, 12, 29)).to eq(-34)
    expect(calc(12, 13, 1)).to eq(26)
    expect(calc(12, 13, 23)).to eq(-21)
    expect(calc(12, 13, 27)).to eq(-29)
    expect(calc(12, 14, 2)).to eq(28)
    expect(calc(12, 14, 15)).to eq(-4)
    expect(calc(12, 14, 17)).to eq(-8)
    expect(calc(12, 15, 11)).to eq(5)
    expect(calc(12, 15, 29)).to eq(-31)
    expect(calc(12, 16, 9)).to eq(37)
    expect(calc(12, 16, 11)).to eq(6)
    expect(calc(12, 16, 12)).to eq(4)
    expect(calc(12, 16, 26)).to eq(-24)
    expect(calc(12, 17, 21)).to eq(-13)
    expect(calc(12, 18, 27)).to eq(-24)
    expect(calc(12, 19, 3)).to eq(34)
    expect(calc(12, 20, 9)).to eq(41)
    expect(calc(12, 21, 16)).to eq(1)
    expect(calc(12, 22, 17)).to eq(0)
    expect(calc(12, 22, 27)).to eq(-20)
    expect(calc(12, 23, 3)).to eq(38)
    expect(calc(12, 24, 11)).to eq(14)
    expect(calc(12, 25, 3)).to eq(40)
    expect(calc(12, 25, 15)).to eq(7)
    expect(calc(12, 25, 16)).to eq(5)
    expect(calc(12, 25, 17)).to eq(3)
    expect(calc(12, 25, 21)).to eq(-5)
    expect(calc(12, 26, 11)).to eq(16)
    expect(calc(12, 26, 19)).to eq(0)
    expect(calc(12, 27, 0)).to eq(39)
    expect(calc(12, 27, 5)).to eq(44)
    expect(calc(12, 27, 11)).to eq(17)
    expect(calc(12, 27, 21)).to eq(-3)
    expect(calc(12, 28, 18)).to eq(4)
    expect(calc(12, 28, 20)).to eq(0)
    expect(calc(12, 29, 29)).to eq(-17)
    expect(calc(13, 0, 1)).to eq(14)
    expect(calc(13, 1, 18)).to eq(32)
    expect(calc(13, 2, 16)).to eq(31)
    expect(calc(13, 3, 7)).to eq(23)
    expect(calc(13, 3, 19)).to eq(35)
    expect(calc(13, 3, 22)).to eq(-6)
    expect(calc(13, 4, 4)).to eq(21)
    expect(calc(13, 7, 5)).to eq(25)
    expect(calc(13, 7, 8)).to eq(28)
    expect(calc(13, 7, 10)).to eq(30)
    expect(calc(13, 7, 18)).to eq(38)
    expect(calc(13, 7, 20)).to eq(40)
    expect(calc(13, 7, 22)).to eq(-2)
    expect(calc(13, 8, 11)).to eq(32)
    expect(calc(13, 8, 21)).to eq(0)
    expect(calc(13, 12, 10)).to eq(35)
    expect(calc(13, 12, 14)).to eq(-3)
    expect(calc(13, 12, 15)).to eq(-5)
    expect(calc(13, 13, 7)).to eq(33)
    expect(calc(13, 14, 4)).to eq(31)
    expect(calc(13, 14, 10)).to eq(37)
    expect(calc(13, 14, 11)).to eq(5)
    expect(calc(13, 16, 26)).to eq(-23)
    expect(calc(13, 17, 2)).to eq(32)
    expect(calc(13, 17, 8)).to eq(38)
    expect(calc(13, 17, 26)).to eq(-22)
    expect(calc(13, 18, 11)).to eq(9)
    expect(calc(13, 18, 23)).to eq(-15)
    expect(calc(13, 19, 1)).to eq(33)
    expect(calc(13, 20, 11)).to eq(11)
    expect(calc(13, 20, 16)).to eq(1)
    expect(calc(13, 21, 9)).to eq(43)
    expect(calc(13, 22, 14)).to eq(7)
    expect(calc(13, 22, 19)).to eq(-3)
    expect(calc(13, 22, 29)).to eq(-23)
    expect(calc(13, 23, 23)).to eq(-10)
    expect(calc(13, 24, 8)).to eq(45)
    expect(calc(13, 24, 15)).to eq(7)
    expect(calc(13, 24, 23)).to eq(-9)
    expect(calc(13, 27, 28)).to eq(-16)
    expect(calc(13, 28, 28)).to eq(-15)
    expect(calc(13, 29, 11)).to eq(20)
    expect(calc(13, 29, 18)).to eq(6)
    expect(calc(14, 0, 27)).to eq(-13)
    expect(calc(14, 1, 15)).to eq(30)
    expect(calc(14, 1, 25)).to eq(-10)
    expect(calc(14, 3, 13)).to eq(30)
    expect(calc(14, 6, 10)).to eq(30)
    expect(calc(14, 7, 19)).to eq(40)
    expect(calc(14, 8, 1)).to eq(23)
    expect(calc(14, 8, 5)).to eq(27)
    expect(calc(14, 8, 23)).to eq(-1)
    expect(calc(14, 8, 25)).to eq(-3)
    expect(calc(14, 8, 26)).to eq(-4)
    expect(calc(14, 10, 19)).to eq(43)
    expect(calc(14, 11, 11)).to eq(3)
    expect(calc(14, 11, 23)).to eq(-21)
    expect(calc(14, 12, 13)).to eq(0)
    expect(calc(14, 12, 22)).to eq(-18)
    expect(calc(14, 13, 0)).to eq(27)
    expect(calc(14, 13, 11)).to eq(5)
    expect(calc(14, 13, 17)).to eq(-7)
    expect(calc(14, 13, 23)).to eq(-19)
    expect(calc(14, 13, 24)).to eq(-21)
    expect(calc(14, 15, 9)).to eq(38)
    expect(calc(14, 16, 4)).to eq(34)
    expect(calc(14, 16, 10)).to eq(40)
    expect(calc(14, 16, 20)).to eq(-10)
    expect(calc(14, 16, 26)).to eq(-22)
    expect(calc(14, 17, 4)).to eq(35)
    expect(calc(14, 17, 9)).to eq(40)
    expect(calc(14, 17, 23)).to eq(-15)
    expect(calc(14, 17, 26)).to eq(-21)
    expect(calc(14, 18, 26)).to eq(-20)
    expect(calc(14, 19, 1)).to eq(34)
    expect(calc(14, 19, 5)).to eq(38)
    expect(calc(14, 19, 7)).to eq(40)
    expect(calc(14, 19, 20)).to eq(-7)
    expect(calc(14, 20, 29)).to eq(-24)
    expect(calc(14, 23, 19)).to eq(-1)
    expect(calc(14, 24, 6)).to eq(44)
    expect(calc(14, 25, 22)).to eq(-5)
    expect(calc(14, 26, 15)).to eq(10)
    expect(calc(14, 26, 17)).to eq(6)
    expect(calc(14, 27, 25)).to eq(-9)
    expect(calc(14, 29, 2)).to eq(45)
    expect(calc(14, 29, 3)).to eq(46)
    expect(calc(14, 29, 4)).to eq(47)
    expect(calc(14, 29, 21)).to eq(1)
    expect(calc(14, 29, 22)).to eq(-1)
    expect(calc(15, 5, 16)).to eq(36)
    expect(calc(15, 5, 20)).to eq(40)
    expect(calc(15, 6, 22)).to eq(-1)
    expect(calc(15, 6, 27)).to eq(-6)
    expect(calc(15, 7, 9)).to eq(31)
    expect(calc(15, 8, 18)).to eq(41)
    expect(calc(15, 9, 0)).to eq(24)
    expect(calc(15, 9, 3)).to eq(27)
    expect(calc(15, 9, 10)).to eq(34)
    expect(calc(15, 10, 20)).to eq(45)
    expect(calc(15, 10, 24)).to eq(1)
    expect(calc(15, 10, 26)).to eq(-1)
    expect(calc(15, 11, 5)).to eq(31)
    expect(calc(15, 11, 22)).to eq(-18)
    expect(calc(15, 11, 24)).to eq(-22)
    expect(calc(15, 12, 29)).to eq(-31)
    expect(calc(15, 13, 16)).to eq(-4)
    expect(calc(15, 13, 25)).to eq(-22)
    expect(calc(15, 14, 11)).to eq(7)
    expect(calc(15, 14, 26)).to eq(-23)
    expect(calc(15, 15, 0)).to eq(30)
    expect(calc(15, 16, 6)).to eq(37)
    expect(calc(15, 16, 8)).to eq(39)
    expect(calc(15, 16, 16)).to eq(-1)
    expect(calc(15, 16, 28)).to eq(-25)
    expect(calc(15, 16, 29)).to eq(-27)
    expect(calc(15, 17, 3)).to eq(35)
    expect(calc(15, 17, 10)).to eq(42)
    expect(calc(15, 17, 28)).to eq(-24)
    expect(calc(15, 18, 11)).to eq(11)
    expect(calc(15, 18, 26)).to eq(-19)
    expect(calc(15, 18, 27)).to eq(-21)
    expect(calc(15, 19, 9)).to eq(43)
    expect(calc(15, 19, 12)).to eq(10)
    expect(calc(15, 19, 24)).to eq(-14)
    expect(calc(15, 19, 29)).to eq(-24)
    expect(calc(15, 20, 15)).to eq(5)
    expect(calc(15, 23, 12)).to eq(14)
    expect(calc(15, 24, 26)).to eq(-13)
    expect(calc(15, 25, 20)).to eq(0)
    expect(calc(15, 25, 28)).to eq(-16)
    expect(calc(15, 27, 20)).to eq(2)
    expect(calc(15, 27, 25)).to eq(-8)
    expect(calc(15, 28, 22)).to eq(-1)
    expect(calc(15, 28, 25)).to eq(-7)
    expect(calc(15, 29, 29)).to eq(-14)
    expect(calc(16, 0, 13)).to eq(29)
    expect(calc(16, 1, 10)).to eq(27)
    expect(calc(16, 1, 22)).to eq(-5)
    expect(calc(16, 2, 2)).to eq(20)
    expect(calc(16, 2, 10)).to eq(28)
    expect(calc(16, 2, 12)).to eq(30)
    expect(calc(16, 2, 15)).to eq(33)
    expect(calc(16, 3, 18)).to eq(37)
    expect(calc(16, 3, 20)).to eq(39)
    expect(calc(16, 4, 6)).to eq(26)
    expect(calc(16, 6, 10)).to eq(32)
    expect(calc(16, 6, 12)).to eq(34)
    expect(calc(16, 7, 1)).to eq(24)
    expect(calc(16, 7, 15)).to eq(38)
    expect(calc(16, 8, 5)).to eq(29)
    expect(calc(16, 9, 12)).to eq(37)
    expect(calc(16, 10, 19)).to eq(45)
    expect(calc(16, 10, 25)).to eq(1)
    expect(calc(16, 11, 26)).to eq(-25)
    expect(calc(16, 11, 29)).to eq(-31)
    expect(calc(16, 12, 3)).to eq(31)
    expect(calc(16, 12, 13)).to eq(2)
    expect(calc(16, 12, 15)).to eq(-2)
    expect(calc(16, 13, 7)).to eq(36)
    expect(calc(16, 13, 13)).to eq(3)
    expect(calc(16, 14, 17)).to eq(-4)
    expect(calc(16, 15, 1)).to eq(32)
    expect(calc(16, 16, 15)).to eq(2)
    expect(calc(16, 17, 4)).to eq(37)
    expect(calc(16, 17, 5)).to eq(38)
    expect(calc(16, 18, 1)).to eq(35)
    expect(calc(16, 18, 4)).to eq(38)
    expect(calc(16, 18, 11)).to eq(12)
    expect(calc(16, 19, 4)).to eq(39)
    expect(calc(16, 19, 17)).to eq(1)
    expect(calc(16, 20, 20)).to eq(-4)
    expect(calc(16, 20, 24)).to eq(-12)
    expect(calc(16, 20, 25)).to eq(-14)
    expect(calc(16, 20, 27)).to eq(-18)
    expect(calc(16, 21, 22)).to eq(-7)
    expect(calc(16, 22, 25)).to eq(-12)
    expect(calc(16, 22, 28)).to eq(-18)
    expect(calc(16, 23, 11)).to eq(17)
    expect(calc(16, 23, 16)).to eq(7)
    expect(calc(16, 23, 18)).to eq(3)
    expect(calc(16, 24, 2)).to eq(42)
    expect(calc(16, 24, 19)).to eq(2)
    expect(calc(16, 25, 5)).to eq(46)
    expect(calc(16, 25, 14)).to eq(13)
    expect(calc(16, 26, 2)).to eq(44)
    expect(calc(16, 26, 8)).to eq(50)
    expect(calc(16, 26, 24)).to eq(-6)
    expect(calc(16, 27, 18)).to eq(7)
    expect(calc(16, 27, 27)).to eq(-11)
    expect(calc(16, 28, 13)).to eq(18)
    expect(calc(16, 28, 14)).to eq(16)
    expect(calc(16, 29, 16)).to eq(13)
    expect(calc(17, 0, 6)).to eq(23)
    expect(calc(17, 0, 8)).to eq(25)
    expect(calc(17, 1, 27)).to eq(-9)
    expect(calc(17, 2, 3)).to eq(22)
    expect(calc(17, 2, 8)).to eq(27)
    expect(calc(17, 3, 18)).to eq(38)
    expect(calc(17, 4, 2)).to eq(23)
    expect(calc(17, 5, 8)).to eq(30)
    expect(calc(17, 5, 14)).to eq(36)
    expect(calc(17, 5, 17)).to eq(39)
    expect(calc(17, 6, 1)).to eq(24)
    expect(calc(17, 6, 2)).to eq(25)
    expect(calc(17, 8, 2)).to eq(27)
    expect(calc(17, 8, 3)).to eq(28)
    expect(calc(17, 8, 15)).to eq(40)
    expect(calc(17, 11, 28)).to eq(-28)
    expect(calc(17, 12, 2)).to eq(31)
    expect(calc(17, 13, 18)).to eq(-6)
    expect(calc(17, 13, 27)).to eq(-24)
    expect(calc(17, 14, 10)).to eq(41)
    expect(calc(17, 14, 16)).to eq(-1)
    expect(calc(17, 14, 24)).to eq(-17)
    expect(calc(17, 14, 28)).to eq(-25)
    expect(calc(17, 15, 23)).to eq(-14)
    expect(calc(17, 16, 19)).to eq(-5)
    expect(calc(17, 16, 23)).to eq(-13)
    expect(calc(17, 17, 16)).to eq(2)
    expect(calc(17, 17, 19)).to eq(-4)
    expect(calc(17, 18, 10)).to eq(45)
    expect(calc(17, 18, 17)).to eq(1)
    expect(calc(17, 20, 1)).to eq(38)
    expect(calc(17, 21, 1)).to eq(39)
    expect(calc(17, 21, 11)).to eq(16)
    expect(calc(17, 22, 7)).to eq(46)
    expect(calc(17, 23, 26)).to eq(-12)
    expect(calc(17, 25, 2)).to eq(44)
    expect(calc(17, 25, 6)).to eq(48)
    expect(calc(17, 25, 10)).to eq(52)
    expect(calc(17, 26, 14)).to eq(15)
    expect(calc(17, 27, 2)).to eq(46)
    expect(calc(17, 27, 4)).to eq(48)
    expect(calc(17, 27, 6)).to eq(50)
    expect(calc(17, 27, 14)).to eq(16)
    expect(calc(17, 28, 7)).to eq(52)
    expect(calc(17, 29, 14)).to eq(18)
    expect(calc(18, 0, 3)).to eq(21)
    expect(calc(18, 0, 9)).to eq(27)
    expect(calc(18, 1, 15)).to eq(34)
    expect(calc(18, 2, 9)).to eq(29)
    expect(calc(18, 3, 3)).to eq(24)
    expect(calc(18, 3, 6)).to eq(27)
    expect(calc(18, 3, 11)).to eq(32)
    expect(calc(18, 4, 10)).to eq(32)
    expect(calc(18, 6, 29)).to eq(-5)
    expect(calc(18, 7, 7)).to eq(32)
    expect(calc(18, 8, 9)).to eq(35)
    expect(calc(18, 8, 19)).to eq(45)
    expect(calc(18, 9, 21)).to eq(6)
    expect(calc(18, 9, 23)).to eq(4)
    expect(calc(18, 10, 1)).to eq(29)
    expect(calc(18, 10, 24)).to eq(4)
    expect(calc(18, 12, 29)).to eq(-28)
    expect(calc(18, 13, 1)).to eq(32)
    expect(calc(18, 14, 3)).to eq(35)
    expect(calc(18, 14, 8)).to eq(40)
    expect(calc(18, 14, 24)).to eq(-16)
    expect(calc(18, 14, 26)).to eq(-20)
    expect(calc(18, 16, 6)).to eq(40)
    expect(calc(18, 16, 9)).to eq(43)
    expect(calc(18, 16, 13)).to eq(8)
    expect(calc(18, 17, 18)).to eq(-1)
    expect(calc(18, 17, 22)).to eq(-9)
    expect(calc(18, 17, 28)).to eq(-21)
    expect(calc(18, 18, 25)).to eq(-14)
    expect(calc(18, 21, 3)).to eq(42)
    expect(calc(18, 21, 21)).to eq(-3)
    expect(calc(18, 22, 12)).to eq(16)
    expect(calc(18, 22, 24)).to eq(-8)
    expect(calc(18, 23, 12)).to eq(17)
    expect(calc(18, 24, 21)).to eq(0)
    expect(calc(18, 25, 21)).to eq(1)
    expect(calc(18, 26, 15)).to eq(14)
    expect(calc(18, 26, 24)).to eq(-4)
    expect(calc(18, 26, 26)).to eq(-8)
    expect(calc(18, 27, 14)).to eq(17)
    expect(calc(18, 27, 17)).to eq(11)
    expect(calc(18, 28, 24)).to eq(-2)
    expect(calc(18, 29, 13)).to eq(21)
    expect(calc(19, 3, 5)).to eq(27)
    expect(calc(19, 3, 21)).to eq(1)
    expect(calc(19, 4, 18)).to eq(41)
    expect(calc(19, 5, 9)).to eq(33)
    expect(calc(19, 6, 25)).to eq(0)
    expect(calc(19, 6, 27)).to eq(-2)
    expect(calc(19, 7, 21)).to eq(5)
    expect(calc(19, 8, 17)).to eq(44)
    expect(calc(19, 8, 20)).to eq(47)
    expect(calc(19, 9, 15)).to eq(43)
    expect(calc(19, 9, 25)).to eq(3)
    expect(calc(19, 9, 27)).to eq(1)
    expect(calc(19, 9, 28)).to eq(0)
    expect(calc(19, 10, 4)).to eq(33)
    expect(calc(19, 10, 5)).to eq(34)
    expect(calc(19, 10, 15)).to eq(44)
    expect(calc(19, 10, 26)).to eq(3)
    expect(calc(19, 10, 28)).to eq(1)
    expect(calc(19, 11, 5)).to eq(35)
    expect(calc(19, 11, 19)).to eq(-8)
    expect(calc(19, 13, 15)).to eq(2)
    expect(calc(19, 13, 16)).to eq(0)
    expect(calc(19, 13, 20)).to eq(-8)
    expect(calc(19, 13, 27)).to eq(-22)
    expect(calc(19, 14, 13)).to eq(7)
    expect(calc(19, 16, 2)).to eq(37)
    expect(calc(19, 16, 13)).to eq(9)
    expect(calc(19, 16, 29)).to eq(-23)
    expect(calc(19, 17, 10)).to eq(46)
    expect(calc(19, 17, 28)).to eq(-20)
    expect(calc(19, 18, 22)).to eq(-7)
    expect(calc(19, 19, 12)).to eq(14)
    expect(calc(19, 20, 2)).to eq(41)
    expect(calc(19, 20, 14)).to eq(11)
    expect(calc(19, 20, 24)).to eq(-9)
    expect(calc(19, 21, 12)).to eq(16)
    expect(calc(19, 21, 26)).to eq(-12)
    expect(calc(19, 22, 20)).to eq(1)
    expect(calc(19, 22, 22)).to eq(-3)
    expect(calc(19, 23, 18)).to eq(6)
    expect(calc(19, 24, 18)).to eq(7)
    expect(calc(19, 25, 15)).to eq(14)
    expect(calc(19, 25, 26)).to eq(-8)
    expect(calc(19, 26, 7)).to eq(52)
    expect(calc(19, 26, 21)).to eq(3)
    expect(calc(19, 27, 7)).to eq(53)
    expect(calc(19, 27, 15)).to eq(16)
    expect(calc(19, 28, 7)).to eq(54)
    expect(calc(19, 28, 21)).to eq(5)
    expect(calc(19, 28, 23)).to eq(1)
    expect(calc(19, 28, 27)).to eq(-7)
    expect(calc(19, 29, 10)).to eq(58)
    expect(calc(19, 29, 11)).to eq(26)
    expect(calc(19, 29, 25)).to eq(-2)
  end
end
